﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sharkbite.Irc;

namespace FredBot
{
    class QuakenetWhoisParser : IParser
    {
        #region IParser Members

        public bool CanParse(string line)
        {
            string[] vals = line.Split(new Char[] { ' ' });
            if (vals.Length < 2)
            {
                return false;
            }

            if (vals[1].Equals("330"))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public void Parse(string message)
        {
            
            string[] vals = message.Split(new Char[] { ' ' });
            // AuthName is the 5th element
            IrcAuthNames.Add(vals[3], vals[4]);
        }

        #endregion

        public Dictionary<string, string> IrcAuthNames = new Dictionary<string,string>();  //IrcNick, AuthName
    }
}
